package com.alpha.redis.test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alpha.core.controller.BaseController;
@Controller
public class DemoController extends BaseController{
	@Autowired  
    DemoService demoService;  
  
    @ResponseBody  
    public String putCache(){  
        demoService.findUser(1l,"wang","yunfei");  
        demoService.findAddress(1l,"anhui","hefei");  
        System.out.println("若下面没出现“无缓存的时候调用”字样且能打印出数据表示测试成功");  
        return "ok";  
    }  
    @ResponseBody  
    public String testCache(){  
        RUser user = demoService.findUser(1l,"wang","yunfei");  
        Address address =demoService.findAddress(1l,"anhui","hefei");  
        System.out.println("我这里没执行查询");  
        System.out.println("user:"+"/"+user.getFirstName()+"/"+user.getLastName());  
        System.out.println("address:"+"/"+address.getProvince()+"/"+address.getCity());  
        return "ok";  
}
}
